﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class ClassAdd : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        DataClassesDataContext db = new DataClassesDataContext();
        tb_Class clas = new tb_Class
        {
           ClassID=int.Parse(TextBox1.Text.ToString()),
           ClassName = TextBox2.Text.ToString()
        };
        db.tb_Class.InsertOnSubmit(clas);
        db.SubmitChanges();
        Reset();
        Response.Write("<script>alert('商品添加成功！')</script>");
    }
    public void Reset()
    {
        TextBox1.Text = "";
        TextBox2.Text = "";
    }
}